"Bazel dependencies"

module(
    name = "aspect_rules_lint",
    version = "1.4.0",
    compatibility_level = 1,
)

bazel_dep(name = "aspect_bazel_lib", version = "2.7.7")

# Needed in the root because we use js_lib_helpers in our aspect impl
# Minimum version needs 'chore: bump bazel-lib to 2.0 by @alexeagle in #1311'
# to allow users on bazel-lib 2.0
bazel_dep(name = "aspect_rules_js", version = "1.40.0")
bazel_dep(name = "bazel_features", version = "1.0.0")
bazel_dep(name = "bazel_skylib", version = "1.4.2")
bazel_dep(name = "platforms", version = "0.0.7")
bazel_dep(name = "rules_multirun", version = "0.9.0")
bazel_dep(name = "rules_multitool", version = "0.4.0")
bazel_dep(name = "rules_diff", version = "1.0.0")

# Needed in the root because we dereference ProtoInfo in our aspect impl
bazel_dep(name = "rules_proto", version = "6.0.0")

# Needed in the root because we dereference the toolchain in our aspect impl
bazel_dep(name = "rules_buf", version = "0.1.1")

multitool = use_extension("@rules_multitool//multitool:extension.bzl", "multitool")
multitool.hub(lockfile = "//format:multitool.lock.json")
multitool.hub(lockfile = "//lint:multitool.lock.json")
use_repo(multitool, "multitool")

rules_lint_toolchains = use_extension("@aspect_rules_lint//lint:extensions.bzl", "toolchains")
rules_lint_toolchains.sarif_parser()
use_repo(rules_lint_toolchains, "sarif_parser_toolchains")

register_toolchains("@sarif_parser_toolchains//:all")

####### Dev dependencies ########

# To allow /tools to be built from source
# NOTE: when publishing to BCR, we patch this to be True, as we publish pre-built binaries with our releases.
IS_RELEASE = True

bazel_dep(
    name = "toolchains_protoc",
    version = "0.4.1",
    dev_dependency = IS_RELEASE,
)
bazel_dep(
    name = "gazelle",
    version = "0.43.0",
    dev_dependency = IS_RELEASE,
)
bazel_dep(
    name = "rules_go",
    version = "0.54.0",
    dev_dependency = IS_RELEASE,
    repo_name = "io_bazel_rules_go",
)

go_sdk = use_extension(
    "@io_bazel_rules_go//go:extensions.bzl",
    "go_sdk",
    dev_dependency = IS_RELEASE,
)
go_sdk.download(version = "1.23.9")

go_deps = use_extension(
    "@gazelle//:extensions.bzl",
    "go_deps",
    dev_dependency = IS_RELEASE,
)
go_deps.from_file(go_mod = "//:go.mod")
use_repo(
    go_deps,
    "com_github_onsi_gomega",
    "com_github_reviewdog_errorformat",
    "com_github_reviewdog_reviewdog",
)
